package ltd.hxya.novel.crawl.service;

import ltd.hxya.novel.common.to.book.BookChapterTo;
import ltd.hxya.novel.common.to.book.BookTo;
import ltd.hxya.novel.common.vo.SearchParam;
import ltd.hxya.novel.crawl.bean.ChapterInfo;
import ltd.hxya.novel.crawl.bean.CrawlTask;
import ltd.hxya.novel.crawl.bean.CrawlVo;
import ltd.hxya.novel.crawl.entity.CrawlRule;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;

public interface CrawlTaskService {
    public List<BookChapterTo> indexInfo(CrawlRule crawlRule, BookTo bookTo) throws IOException;

    BookTo novelInfo(String bookId,Integer crawlId) throws IOException, ExecutionException, InterruptedException;

    List<BookTo> crawlNovelList(Integer crawlId, String keyword) throws IOException, ExecutionException, InterruptedException;

    List<ChapterInfo> crawlIndexList(BookTo bookTo) throws IOException;

    void addBookIndex(CrawlTask crawlTask);

    void searchCrawlBook(SearchParam searchParam);

    public void crawlNovelByCrawlId(String bookId) throws IOException;

    public void renewNovel();

    public void crawlChapter(BookTo bookTo);


    void allAvailableUrl(CrawlVo crawlVo, Map<String,List<String>> idMap) throws IOException;

    void chapterFilterWord(String keyword);

    void crawlNovelByCrawlId(String bookId, Integer sourceId) throws IOException;
}
